package com.yunshipei.common.wedigt;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.CheckBox;

import com.yunshipei.common.manager.EnterConfig;
import com.yunshipei.enterplorer.R;
import com.yunshipei.utils.DrawableUtils;


public class EnterplorerCheckBox extends CheckBox {
    public EnterplorerCheckBox(Context context) {
        super(context);
        init(context);
    }

    public EnterplorerCheckBox(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    public EnterplorerCheckBox(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
    }

    private void init(Context context) {
        Drawable normalDraw = context.getResources().getDrawable(R.drawable.select_off);
        Drawable inIcon = context.getResources().getDrawable(R.drawable.icon_checked_src);
        Drawable cDraw = DrawableUtils.getYspCheckBoxDraw(EnterConfig.getInstance().getGlobalColor(), normalDraw, inIcon);
        setBackground(cDraw);
    }
}
